/**
 * Created by Administrator on 2017/3/21.
 */
import React, {Component} from 'react';
import {Form, Input, Radio, Select,   Icon,
  Upload, } from 'antd';
import {connect} from 'dva';
import moment from 'moment'
import request from '@/utils/request';
const FormItem = Form.Item;
const { TextArea } = Input;
const RadioGroup = Radio.Group;
const Option = Select.Option;
class AddPoliciesForm extends Component {
  constructor(props) {
    super(props);
    this.state = {
      fileList:[]
    };
  }

  componentDidMount() {
  }
  render() {
    const formItemLayoutWithLabel = {
      labelCol: {
        xs: {span: 24},
        sm: {span: 6},
      },
      wrapperCol: {
        xs: {span: 24},
        sm: {span: 15},
      }
    };

    const {getFieldDecorator} = this.props.form;
    const props = {
      onRemove: (file) => {
        this.setState(({ fileList }) => {
          const index = fileList.indexOf(file);
          const newFileList = fileList.slice();
          newFileList.splice(index, 1);
          return {
            fileList: newFileList,
          };
        });
      },
      beforeUpload: (file) => {
        this.setState(({ fileList }) => ({
          fileList: [file],
        }));
        return false;
      },
      fileList: this.state.fileList,
    };
    return (
      <div>
        <Form onSubmit={this.handleSubmit}>
          <FormItem
            {...formItemLayoutWithLabel}
            label={(
              <span>
               巡检员
            </span>
            )}
          >
            {getFieldDecorator('project_name', {
              initialValue: '',
              rules: [{ required: true, message: '请选择巡检员' }],
            })(
              <Select >
                <Option  value={'帅学华'}>{'帅学华'}</Option>
              </Select>
            )}
          </FormItem>
          <FormItem
            {...formItemLayoutWithLabel}
            label={(
              <span>
               工单主题
            </span>
            )}
          >
            {getFieldDecorator('topic', {
              initialValue: '',
              rules: [{ required: true, message: '请输入工单主题' }],
            })(
              <TextArea  rows={2}  />
            )}
          </FormItem>
          <FormItem
            {...formItemLayoutWithLabel}
            label={(
              <span>
               工单地址
            </span>
            )}
          >
            {getFieldDecorator('topic', {
              initialValue: '',
              rules: [{ required: true, message: '请输入工单地址' }],
            })(
              <TextArea  rows={2}  />
            )}
          </FormItem>
          <FormItem
            {...formItemLayoutWithLabel}
            label={(
              <span>
               工单备注
            </span>
            )}
          >
            {getFieldDecorator('remark', {
              initialValue: '',
            })(
              <TextArea  rows={2}  />
            )}
          </FormItem>

        </Form>
      </div>
    );
  }
}

const AddPoliciesFormWrap = Form.create()(AddPoliciesForm);
export default connect()(AddPoliciesFormWrap);


